﻿using System.ComponentModel.DataAnnotations;

namespace Journal.Front.Presentation.Attributes
{
    public class CustomRequiredStringAttribute : RequiredAttribute
    {
        public CustomRequiredStringAttribute()
        {
            this.ErrorMessage = ValidateMessages.StringRequiredTemplate;
        }

        public override bool IsValid(object value)
        {
            string str = value as string;
            return !string.IsNullOrEmpty(str);
        }
    }
}